<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>括号生成算法解析 | 优雅的编程艺术</title>
    <link href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <link href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            background-color: #f8f9fa;
            color: #333;
            line-height: 1.6;
        }
        .hero {
            background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
        }
        .code-block {
            background-color: #282c34;
            border-radius: 8px;
            box-shadow: 0 10px 20px rgba(0,0,0,0.1);
        }
        .card {
            transition: transform 0.3s ease, box-shadow 0.3s ease;
            border-radius: 12px;
            overflow: hidden;
        }
        .card:hover {
            transform: translateY(-5px);
            box-shadow: 0 15px 30px rgba(0,0,0,0.15);
        }
        .highlight {
            background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(74,144,226,0.1) 100%);
            border-left: 4px solid #4a90e2;
        }
        .first-letter {
            font-size: 3.5em;
            line-height: 0.8;
            float: left;
            margin-right: 8px;
            color: #1e3c72;
            font-weight: 700;
        }
    </style>
</head>
<body class="antialiased">
    <!-- Hero Section -->
    <section class="hero text-white py-20 px-6 md:py-32">
        <div class="container mx-auto max-w-5xl">
            <div class="flex flex-col md:flex-row items-center">
                <div class="md:w-1/2 mb-10 md:mb-0">
                    <h1 class="text-4xl md:text-5xl font-bold mb-4 font-serif">括号生成算法</h1>
                    <p class="text-xl opacity-90 mb-6">回溯思想的优雅实践</p>
                    <div class="flex items-center">
                        <span class="bg-white bg-opacity-20 rounded-full px-4 py-1 mr-3">
                            <i class="fas fa-code mr-2"></i>算法
                        </span>
                        <span class="bg-white bg-opacity-20 rounded-full px-4 py-1">
                            <i class="fas fa-brain mr-2"></i>回溯
                        </span>
                    </div>
                </div>
                <div class="md:w-1/2 flex justify-center">
                    <div class="w-64 h-64 relative">
                        <div class="absolute inset-0 bg-blue-500 rounded-full opacity-20 animate-pulse"></div>
                        <div class="relative z-10 flex items-center justify-center h-full">
                            <div class="text-center">
                                <div class="text-6xl mb-2">()</div>
                                <div class="text-lg font-medium">合法组合</div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Main Content -->
    <section class="py-16 px-6">
        <div class="container mx-auto max-w-5xl">
            <!-- Problem Description -->
            <div class="card bg-white p-8 mb-12">
                <h2 class="text-3xl font-bold mb-6 text-gray-800 border-b pb-3 flex items-center">
                    <i class="fas fa-question-circle text-blue-500 mr-3"></i>
                    题目描述
                </h2>
                <p class="text-lg text-gray-700 leading-relaxed">
                    <span class="first-letter">数</span>字 n 代表生成括号的对数，请你编写一个函数，生成所有由 n 对括号组成的合法括号组合。
                </p>
            </div>

            <!-- Core Concept -->
            <div class="card bg-white p-8 mb-12">
                <h2 class="text-3xl font-bold mb-6 text-gray-800 border-b pb-3 flex items-center">
                    <i class="fas fa-lightbulb text-yellow-500 mr-3"></i>
                    核心考点与算法
                </h2>
                <div class="flex flex-col md:flex-row gap-8">
                    <div class="md:w-1/2">
                        <h3 class="text-xl font-semibold mb-4 text-blue-600">回溯算法</h3>
                        <p class="text-gray-700 mb-4">
                            回溯法是一种通过探索所有可能的解来找出所有解的算法。它通过递归尝试各种可能性，并在不满足条件时回退到上一步继续尝试其他可能性。
                        </p>
                        <div class="bg-blue-50 p-4 rounded-lg mb-4">
                            <h4 class="font-medium text-blue-700 mb-2">关键特点：</h4>
                            <ul class="list-disc pl-5 text-gray-700 space-y-1">
                                <li>系统地搜索解空间</li>
                                <li>通过递归实现</li>
                                <li>遇到无效解时"回溯"</li>
                                <li>适合组合问题</li>
                            </ul>
                        </div>
                    </div>
                    <div class="md:w-1/2">
                        <div class="m